<html>
<head><meta charset="utf-8"><title>Multiple impl blocks for built-in types (lang items?) · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html">Multiple impl blocks for built-in types (lang items?)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="208789609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208789609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Kalbertodt <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208789609">(Sep 02 2020 at 07:43)</a>:</h4>
<p>Hello there lang people! We are currently adding a bunch of methods to array directly. A lang item was added and the <code>impl&lt;T, const N: usize&gt; [T; N]</code> impl block was annotated with <code>#[lang = "array"]</code>. </p>
<p>However, we would like to add different impl blocks, for example <code>impl&lt;T, const N: usize&gt; [&amp;T; N] where T: Copy</code> in order to add a <code>copied</code> method. How would we best do that? We couuuld add a lang item for each impl block, but that seems annoying and wrong somehow (we might want 5 or more additional impl blocks). </p>
<p>I already asked <span class="user-mention" data-user-id="216206">@lcnr</span>  about this and they said that an attribute like <code>#[rustc_primitive_impl]</code> might be the best way forward. But they were not sure and mentioned <span class="user-mention" data-user-id="116009">@nikomatsakis</span>  and <span class="user-mention" data-user-id="119009">@eddyb</span>  as people who would know about this. I unfortunately hardly know anything about that part of the compiler, so if someone could help out, that would be great :)</p>



<a name="208791945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208791945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208791945">(Sep 02 2020 at 08:11)</a>:</h4>
<p>Personally I'd consider this a libs-impl question, not a lang one -- the perma-unstable attributes that can be used for such things aren't part of the language specification, IMHO.  (If a different implementation wanted to do them as pure compiler magic, or just disabled coherence entirely in core, or ... that would I think still be a compliant implementation of the hypothetical spec.)</p>
<p>I don't really know about that part of the compiler either.  I just figure the answer probably isn't to allow lang items on multiple things, since most of the code consuming them wouldn't want to have to deal with that.  A new <code>rustc_*</code> attribute sounds completely reasonable.</p>



<a name="208804398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208804398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Kalbertodt <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208804398">(Sep 02 2020 at 10:31)</a>:</h4>
<p>Oh dang, yeah opening this topic in <code>t-lang</code> was a mistake :/ I think I meant to put it into <code>t-compiler</code> as there are likely many people who know about the relevant compiler parts. Can I/we move a topic?</p>



<a name="208804493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208804493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208804493">(Sep 02 2020 at 10:32)</a>:</h4>
<p>Only mods can move between streams.</p>



<a name="208807249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208807249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208807249">(Sep 02 2020 at 10:59)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="213817" href="/#narrow/stream/213817-t-lang/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20.28lang.20items.3F.29">#t-lang &gt; Multiple impl blocks for built-in types (lang items?)</a> by <span class="user-mention silent" data-user-id="116107">davidtwco</span></p>



<a name="208814262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208814262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208814262">(Sep 02 2020 at 12:15)</a>:</h4>
<p>Whatever you decide, please remember to update rustdoc ^^<br>
<a href="https://github.com/rust-lang/rust/blob/master/src/librustdoc/clean/types.rs#L1283">https://github.com/rust-lang/rust/blob/master/src/librustdoc/clean/types.rs#L1283</a></p>



<a name="208814373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208814373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208814373">(Sep 02 2020 at 12:16)</a>:</h4>
<p>It sounds like <code>lang = array</code> was already added? Then the docs for that won't work until rustdoc is updated</p>



<a name="208916505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208916505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208916505">(Sep 03 2020 at 03:25)</a>:</h4>
<p>you can create however many lang items you need, I think , just need to update all the relevant places</p>



<a name="208916525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208916525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208916525">(Sep 03 2020 at 03:25)</a>:</h4>
<p>a new <code>rustc_*</code> attribute would be a bit tricky as you'd have to update everything relying on the existing lang items - it's not just allowing them in coherence, but <em>finding</em> the impls is also done through the lang items</p>



<a name="208916566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208916566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208916566">(Sep 03 2020 at 03:26)</a>:</h4>
<p>IIRC we have several lang items for some things where e.g. one of the impls is in <code>alloc</code></p>



<a name="208916575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208916575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208916575">(Sep 03 2020 at 03:26)</a>:</h4>
<p>yup:</p>
<div class="codehilite"><pre><span></span><code><span class="w">                </span><span class="n">Str</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">both</span><span class="p">(</span><span class="n">lang_items</span><span class="p">.</span><span class="n">str_impl</span><span class="p">(),</span><span class="w"> </span><span class="n">lang_items</span><span class="p">.</span><span class="n">str_alloc_impl</span><span class="p">()),</span><span class="w"></span>
</code></pre></div>



<a name="208916585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208916585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208916585">(Sep 03 2020 at 03:26)</a>:</h4>
<p>I'm proud of that rustdoc code, it's very clean :) unlike the rest of rustdoc lol</p>



<a name="208935488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208935488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208935488">(Sep 03 2020 at 08:30)</a>:</h4>
<blockquote>
<p>you can create however many lang items you need, I think , just need to update all the relevant places</p>
</blockquote>
<p>yeah, but considering that we want impls for at least <code>[u8; N]</code>, <code>[T; N]</code> , <code>[&amp;T; N]</code> and <code>[&amp;mut T; N]</code> which will potentially be split between core and alloc I kind of feel like adding that many lang items seems quite unfortunate so imo it might be a better to merge all of this using a single attribute</p>



<a name="208958552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208958552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208958552">(Sep 03 2020 at 12:27)</a>:</h4>
<p>I don't think there's any reason to not have multiple lang items personally - we can even just have opaque numbered names for them or something</p>



<a name="208977531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208977531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208977531">(Sep 03 2020 at 14:40)</a>:</h4>
<p>Can we allow multiple instances of a given lang-item impl in the same crate? Just as you can have many impls of a type you own...</p>



<a name="208978225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208978225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208978225">(Sep 03 2020 at 14:45)</a>:</h4>
<blockquote>
<p>Can we allow multiple instances of a given lang-item impl in the same crate? Just as you can have many impls of a type you own...</p>
</blockquote>
<p>I don't think so, we currently have a 1 to 1 correspondence between lang items and <code>DefId</code>s</p>



<a name="208990728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208990728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208990728">(Sep 03 2020 at 16:05)</a>:</h4>
<p>but is that fundamentally 1:1, or something that could change?</p>



<a name="208991040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208991040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208991040">(Sep 03 2020 at 16:08)</a>:</h4>
<p>I personally think that this is fairly fundamental, or at least I don't think changing this is worth it, which is why I would instead like to use an attribute for this</p>



<a name="208991125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/208991125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#208991125">(Sep 03 2020 at 16:08)</a>:</h4>
<p>which can easily be applied to multiple items</p>



<a name="209013495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209013495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209013495">(Sep 03 2020 at 18:54)</a>:</h4>
<p><span class="user-mention" data-user-id="138448">@cuviper</span> multiple instances isn't  more useful than a special attribute. both have the same problems</p>



<a name="209013999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209013999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209013999">(Sep 03 2020 at 18:58)</a>:</h4>
<p><span class="user-mention" data-user-id="138448">@cuviper</span> the problem with primitive types is they don't have definitions like "types you own", so there's nothing to attach <code>impl</code>s to. lang items enforce "at most 1 in the entire crate graph" so they serve as an approximation</p>



<a name="209014061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209014061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209014061">(Sep 03 2020 at 18:59)</a>:</h4>
<p>note that if we do <code>struct str([u8]);</code> that solves the problem for that type. sadly, not really applicable to structural primitives like arrays</p>



<a name="209014437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209014437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209014437">(Sep 03 2020 at 19:01)</a>:</h4>
<p><span class="user-mention" data-user-id="138448">@cuviper</span> <span class="user-mention" data-user-id="216206">@lcnr</span> there <em>is</em> one possibility that I don't think was taken seriously, heh. using <code>#[lang_item = ...]</code> on a module/crate, and looking up primitive impls in that crate</p>



<a name="209014554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209014554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209014554">(Sep 03 2020 at 19:02)</a>:</h4>
<p>then we'd just have a <code>core</code> and an <code>alloc</code> special-case</p>



<a name="209014633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209014633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209014633">(Sep 03 2020 at 19:03)</a>:</h4>
<p>tying to the module/crate sounds like a nice trade-off</p>



<a name="209014753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209014753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209014753">(Sep 03 2020 at 19:04)</a>:</h4>
<p>it's already what the lang items for primitives impl already do, just in a roundabout way</p>



<a name="209014855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209014855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209014855">(Sep 03 2020 at 19:05)</a>:</h4>
<p>it still doesn't solve the problem of tracking those impls, so they'd have to just be per-crate "primitive inherent impls" and work a bit like the attribute (but easier to get the full list of them)</p>



<a name="209024730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209024730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209024730">(Sep 03 2020 at 20:23)</a>:</h4>
<blockquote>
<p>(but easier to get the full list of them)</p>
</blockquote>
<p>yes please!</p>



<a name="209145378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Multiple%20impl%20blocks%20for%20built-in%20types%20%28lang%20items%3F%29/near/209145378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Multiple.20impl.20blocks.20for.20built-in.20types.20(lang.20items.3F).html#209145378">(Sep 04 2020 at 22:07)</a>:</h4>
<p>Possibly-related <a href="https://github.com/rust-lang/rust/pull/76311">https://github.com/rust-lang/rust/pull/76311</a> mentions that <code>#[lang = "slice"]</code> is _itself_ over the tidy limit, so having multiple inherent impl blocks for primatives may be useful even when where different bounds are unneeded.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>